package com.example.administrator.testproject.refresh;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import com.example.administrator.testproject.R;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;

public class EmptyActivity extends AppCompatActivity {

    private SmartRefreshLayout refreshLayout;
    private ListView listView;
//    private String[] city = {} ;
    private String[] city = {"广州","深圳","北京","上海","香港","澳门","天津","广州","深圳","北京","上海","香港","澳门","天津"} ;
    private ArrayAdapter<String> arrayAdapter;
    private View emptyView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_empty);
        refreshLayout = (SmartRefreshLayout)findViewById(R.id.refresh);
        listView = (ListView)findViewById(R.id.listview);
        emptyView = findViewById(R.id.empty);
        arrayAdapter = new ArrayAdapter<String>(EmptyActivity.this,android.R.layout.simple_list_item_1, city);
        listView.setAdapter(arrayAdapter);
        listView.setEmptyView(emptyView);
    }
}
